import yaml
from tools import soccer_address, profile_address


# 获取配置文件中的权重数据
class DataInformation:
    # 初始化打开需要打开的配置文件
    def __init__(self):
        with open(soccer_address() + profile_address(["data", "weight"], a=True), "r", encoding="utf-8") as r:
            # 使用load方法将配置文件以字典的方式展示出来
            self.env = yaml.load(r, Loader=yaml.FullLoader)

    # 根据给出的位置信息，读取出对应的权重数据
    def weight_data(self, position):
        return self.env["weight_data"][position]


if __name__ == "__main__":
    print(DataInformation().weight_data("CM"))
